﻿using System;
using System.Collections.Generic;
using Identity.ViewModels;

namespace Fee.ViewModel
{
    public class FrameworkContractDetialEditorViewModel : FrameworkContractSimpleViewModel

    {
        public FrameworkContractDetialEditorViewModel()
        {
        }

        public FrameworkContractDetialEditorViewModel(FrameworkContract contract) : base(contract)
        {
         
        }

        public IList<ProjectSimpleViewModel> Projects { get; set; } = new List<ProjectSimpleViewModel>();
    }


    public class FrameworkContractSimpleViewModel
    {
        public FrameworkContractSimpleViewModel()
        {
        }

        public FrameworkContractSimpleViewModel(FrameworkContract contract)
        {
            if (contract == null) throw new ArgumentNullException(nameof(contract));
            Id = contract.Id;
            Name = contract.Name;
            No = contract.No;
            if (contract.Vendor != null)
                Vendor = new VendorSimpleViewModel(contract.Vendor);
        }

        public VendorSimpleViewModel Vendor { get; set; }
        public int Id { get; set; }
        public string Name { get; set; }
        public string No { get; set; }
    }
}